//
//  ViewController.m
//  FKTabBarController
//
//  Created by 云眼科技 on 16/7/30.
//  Copyright © 2016年 CloudEyes. All rights reserved.
//

#import "ViewController.h"
#import "SecondVC.h"

#import "FKTabBarController/FKTabBar.h"

@interface FKBtn : UIButton 

@end

@implementation FKBtn



-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    return contentRect;
}

@end




@interface ViewController ()<UIViewControllerTransitioningDelegate>{
    FKBackgroundView *backView;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    FKBtn *btn = [[FKBtn alloc] init];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    btn.frame = CGRectMake(150, 200, 50, 30);
    [btn setTitle:@"测试" forState:UIControlStateNormal];
    btn.titleLabel.textAlignment = NSTextAlignmentCenter;
    btn.titleLabel.font = [UIFont systemFontOfSize:15.f];
    [btn addTarget: self action:@selector(gotoNextVC:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
//    
//    
//    UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(btn.frame.size.width - 10, 0, 10, 10)];
//    testView.backgroundColor = [UIColor redColor];
//    testView.layer.cornerRadius = 5.f;
//    [btn addSubview:testView];
    
    NSMutableArray <NSString *> *array = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < 10; i ++) {
        [array addObject:@"推荐"];
    }
    
    
    FKTabBar *tabBar = [[FKTabBar alloc] initWithFrame:CGRectMake(0, 64, 375, 40) titleArray:array];
    
    
//    self.navigationItem.titleView = tabBar;
    
    [self.view addSubview:tabBar];
    

    
    
    
    
    
//    backView = [[FKBackgroundView alloc] initWithFrame:CGRectMake(100, 300, 30, 30)];
//    backView.type = FKBackgroundViewTypeRoundRectFill;
//    [self.view addSubview:backView];
    

    
}

-(void)foo:(FKTabBarItem *)item{
    [item removeIndicator];
}

-(void)gotoNextVC:(UIButton *)sender{
    SecondVC *vc = [[SecondVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}



@end
